<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddColumnContentTypeToMobileSmsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('mobile_sms', function (Blueprint $table) {
            $table->string('content_type')->default('sms')
                ->comment('消息内容类型：register 注册，password_reset 密码找回；');
            $table->integer('is_used')->default(0)->comment('验证码使用状态：0 未使用； 1 已使用')->after('code');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('mobile_sms', function (Blueprint $table) {
            $table->dropColumn(['content_type', 'is_used']);
        });
    }
}
